package Program;

import Func.Goble;
import Kit.FileIO;

import java.io.IOException;
import java.util.*;

import Func.*;
import Object.*;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;

import static Func.Goble.*;

public class Test
{
    public static void main(String[] args) throws IOException
    {
        /*FileIO io = new FileIO();
        ArrayList<String> moviesFile = io.readFile("d:/teamdata/movies.dat");
        ArrayList<String> ratingsFile = io.readFile("d:/teamdata/ratings_train.dat");

        GobleKit.initMovies(moviesFile);
        GobleKit.initRatings(ratingsFile);
        GobleKit.initMapping();*/
/*
        ObjectMapper objectMapper = new ObjectMapper();
        HashMap<Integer,HashMap<Integer,Rating>> mapping = new HashMap<>();
        String test = "{\"265\":{\"userId\":30771, \"movieId\":265, \"rating\":5.0, \"date\":\"836397047\"}, \"457\":{\"userId\":30771, \"movieId\":457, \"rating\":4.0, \"date\":\"836397326\"}}";
        mapping.put(1,objectMapper.readValue(test,new TypeReference<HashMap<Integer,Rating>>(){}));
        System.out.println(mapping.get(1));
*/

        long startTime1 =  System.currentTimeMillis();

        FileIO io = new FileIO();
        io.readMovieList("d:/teamdata/cache/system/movieList.dat");

        System.out.println();
        System.out.println(user_to_item.get(1));
        //ratingList = io.readRatingListCache("d:/teamdata/cache/system/initRatings.dat");
        //System.out.println(ratingList.get(1));
        long endTime1 =  System.currentTimeMillis();
        System.out.println((endTime1-startTime1));

    }
}
